﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebTeamplate
{
    public partial class Admin_usercontrol_ucSubCategoryTrans : BaseUserControl
    {
        #region Fields
        public string languageName = string.Empty;
        public string languabeCode = string.Empty;
        public string id = string.Empty;
        #endregion

        #region Properties
        public string NameValue
        {
            get
            {
                return this.txtName.Text;
            }
            set
            {
                this.txtName.Text = value;
            }
        }

        public bool RequireName
        {
            get
            {
                return this.refvName.Enabled;
            }
            set
            {
                this.refvName.Enabled = value;
                if (value)
                {
                    if (!lblName.Text.Contains(CommonFunction.DEFAULT_COMMENT_REQUIREINPUT))
                        lblName.Text += CommonFunction.DEFAULT_COMMENT_REQUIREINPUT + ":";
                }
                else
                {
                    if (!lblName.Text.Contains(":"))
                        lblName.Text += ":";
                }
            }
        }

        public string DIVID
        {
            set
            {
                this.id = value;
            }
        }
        public string TextLabelName
        {
            set
            {
                this.lblName.Text = value;
            }
            get
            {
                return lblName.Text;
            }

        }

        public string ValidationGroup
        {
            get
            {
                return this.refvName.ValidationGroup;
            }
            set
            {
                refvName.ValidationGroup = refvName.ValidationGroup = value;
            }
        }
        #endregion

        #region Init,Load
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                InitPara();
            }
        }
        #endregion

        #region Methods
        private void InitPara()
        {

            refvName.ErrorMessage = string.Format(Resources.Resource.MESSAGE_REQUIRE_INPUT, CommonFunction.GetTextLabel(lblName));

        }
        #endregion

        #region Events
        #endregion
    }

}